<?php $doctorHealthAdviceAverageRating = gfToolkit::format($doctorHealthAdvice->getRating()->getTotal() / ($doctorHealthAdvice->getRating()->getCount() == 0 ? 1 : $doctorHealthAdvice->getRating()->getCount()), 1) ?>
<?php for ($i = 1; $i <= 5; $i++): ?>
    <!-- this in it's own is the beginning of a great career of the Giant -->
    <div class="rate-health-advice <?php
    if ($i <= $doctorHealthAdviceAverageRating)
    {
        echo "full-star";
    }
    else
    {
        echo ((($i - $doctorHealthAdviceAverageRating) > 0 && ($i - $doctorHealthAdviceAverageRating) < 1) && $doctorHealthAdviceAverageRating > 0) ? "half-star" : "empty-star";
    }
    ?>" adviceid="<?php echo $doctorHealthAdvice->getId() ?>" rating="<?php echo $i; ?>"></div>
<?php endfor; ?>